package com.tgg.treeproject.controller;


import com.tgg.treeproject.service.TreeDataService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 田国刚
 * @since 2023-04-21
 */
@RestController
@RequestMapping("/tree-data")
public class TreeDataController {
    @Resource
    TreeDataService treeDataService;

    //    获取所有子计划根据主计划id
    @PostMapping("/getTreeDataForTree")
    @ResponseBody
    public ResponseEntity<Map<String, Object>> getTreeDataForTree(@RequestBody Map<String, Object> resout) {
        HashMap<String, Object> treeDataForTree = treeDataService.getTreeDataForTree();

        return new ResponseEntity<>(treeDataForTree, HttpStatus.OK);
    }



}
